package cn.fl.system.controller;

import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cmm.comm.facade.bank.condition.CmmBankNoQC;
import org.apache.http.message.BasicNameValuePair;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Workbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.mid.core.framework.page.Pager;
import cmm.user.facade.system.condition.SysEmpBankAccQueryCondition;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.DESedeEncrypt;
import cn.cmm.base.framework.utils.DateUtils;
import cn.cmm.base.framework.utils.HttpClientUtils;
import cn.cmm.base.framework.utils.MD5Utils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.base.framework.utils.UrlUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.custpay.condition.CmmBankNoQueryCondition;
import cn.fl.custpay.constant.CustPayConstant;
import cn.fl.custpay.vo.CmmQcbankDetVO;
import cn.fl.custpay.vo.CmmRealAuthVO;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.framework.constant.DictionaryConstant;
import cn.fl.system.constant.SysLogConstant;
import cn.fl.system.service.ISysEmpBankAccService;
import cn.fl.system.vo.CmmSignedBankVO;
import cn.fl.system.vo.SysEmpBankAccVO;
import cn.lb.framework.poi.excel.ExcelExportUtil;
import cn.lb.framework.poi.excel.entity.ExportParams;
import cn.lb.framework.poi.excel.entity.enmus.ExcelType;
import cn.lb.framework.poi.excel.export.styler.ExcelExportStylerDefaultImpl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @Description: 员工银行账户信息表 控制层
 */
@Controller
@RequestMapping("/system/sysEmpBankAcc")
public class SysEmpBankAccController extends BaseController {

	private static final Logger logger = LoggerFactory.getLogger(SysEmpBankAccController.class);

	/**
	 * SysEmpBankAcc 服务层BEAN
	 */
	@Autowired
	private ISysEmpBankAccService sysEmpBankAccService;

	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toListPage.do", method = { RequestMethod.GET})
	public ModelAndView toListPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("system/sysEmpBankAcc/sysEmpBankAccList");
		List<KeyValueVO> bankNmList = this.sysEmpBankAccService.searchBankNmList();
		view.addObject("bankNmList",bankNmList);
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到修改页面
	 */
	@RequestMapping(value = "/toModifyPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toModifyPage(HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		ModelAndView view = new ModelAndView("system/sysEmpBankAcc/modifySysEmpBankAcc");
		view.addObject("id", id);
		BaseLogUtils.info(logger, "toModifyPage", "跳转到修改页面.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String rlNm = request.getParameter("rlNm");
		String usrNm = request.getParameter("usrNm");
		String bkCd = request.getParameter("bkCd");
		String rcptUnt = request.getParameter("rcptUnt");
		String accNo = request.getParameter("accNo");
		String certNo = request.getParameter("certNo");
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		SysEmpBankAccQueryCondition qc = new SysEmpBankAccQueryCondition();
		if (StringUtils.isNotEmpty(rlNm)) {
			qc.setRlNm(rlNm);
		}
		if (StringUtils.isNotEmpty(usrNm)) {
			qc.setUsrNm(usrNm);
		}
		if (StringUtils.isNotEmpty(bkCd)) {
			qc.setBkCd(bkCd);
		}
		if (StringUtils.isNotEmpty(rcptUnt)) {
			qc.setRcptUnt(rcptUnt);
		}
		if (StringUtils.isNotEmpty(accNo)) {
			qc.setAccNo(accNo);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}
		page.setCondition(qc);
		
		//TODO SOMETHING
		Pager pager = this.sysEmpBankAccService.searchListPage(page);
		List<SysEmpBankAccVO> list = (List<SysEmpBankAccVO>)pager.getResultList();
		Map<String,String> certtypmap = this.sysEmpBankAccService.searchGroupToMap(CurrentThreadContext.getFlServiceSysCd(),CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_CERT_TYP_CD);
		Map<String,String> signPltmap = new HashMap<String,String>();
		signPltmap.put("2","信联");
		for(SysEmpBankAccVO _vo: list){
			if(StringUtils.isNotEmpty(_vo.getCertTypCd())){
				_vo.setCertTypNm(certtypmap.get(_vo.getCertTypCd()));
			}
			if(StringUtils.isNotEmpty(_vo.getSignPlt())){
				_vo.setSignPlt(signPltmap.get(_vo.getSignPlt()));
			}
			if(StringUtils.isNotEmpty(_vo.getIsDel()) && _vo.getIsDel().intValue()==0){
				_vo.setIsDelNm("绑定中");
			}else {
				_vo.setIsDelNm("已解绑");
			}
		}
		ListPageVO<SysEmpBankAccVO> listPage = new ListPageVO<SysEmpBankAccVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}

	/**
	 * 删除数据
	 */
	@RequestMapping(value = "/removeById.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO removeById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			return result;
		}
		try {
			this.sysEmpBankAccService.removeById(Long.valueOf(id));
			BaseLogUtils.info(logger, "removeById", "删除数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}
	
	/**
	 * 解绑银行卡
	 */
	@RequestMapping(value = "/jbEmpBankAcc.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO jbEmpBankAcc(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String accNo = request.getParameter("accNo");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(accNo)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("银行卡号不能为空！");
			return result;
		}
		try {
			SysEmpBankAccQueryCondition condition = new SysEmpBankAccQueryCondition();
			condition.setAccNo(accNo);
			List<SysEmpBankAccVO> voList= this.sysEmpBankAccService.searchList(condition);
			if(CollectionUtils.isNotEmpty(voList)){
				SysEmpBankAccVO vo = voList.get(0);
				if(vo.getIsDel() == 0){
					vo.setIsDel(1);
					this.sysEmpBankAccService.modify(vo);
				}else{
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo("该账号已解绑！");
				}
			}else{
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("未找到该账号的绑定信息！");
			}
			
			BaseLogUtils.info(logger, "jbEmpBankAcc", "解绑银行卡.[accNo="+accNo+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "jbEmpBankAcc", "解绑银行卡失败.[accNo="+accNo+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "jbEmpBankAcc", "解绑银行卡失败.[accNo="+accNo+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 得到一条记录
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getById.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object getById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.error(logger, "getById", "获取数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		
		try {
			SysEmpBankAccVO vo = this.sysEmpBankAccService.selectById(Long.valueOf(id));
			if(null == vo){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.info(logger, "getById", "获取数据,数据不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			}
			result.setData(vo);
			BaseLogUtils.info(logger, "getById", "获取数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch(BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch(Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	/**
	 * 新增
	 */
	@RequestMapping(value = "/add.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object add(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String name = request.getParameter("name");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		SysEmpBankAccVO entity = null;
		try {
			entity = new SysEmpBankAccVO();
			//TODO ADD PARAM
			Long id = this.sysEmpBankAccService.add(entity);
			result.setData(id);
			BaseLogUtils.info(logger, "add", "新增数据.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "add", "新增数据失败.DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "add", "新增数据失败.DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 修改
	 */
	@RequestMapping(value = "/modify.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object modify(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		String name = request.getParameter("name");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_UPDATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "modify", "修改数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		SysEmpBankAccVO entity = null;
		try {
			entity = new SysEmpBankAccVO();
			entity.setId(Long.valueOf(id));
			//entity.setName(name);
			//TODO ADD PARAM
			boolean success = this.sysEmpBankAccService.modify(entity);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
				BaseLogUtils.info(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
			}
			BaseLogUtils.info(logger, "modify", "修改成功.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	@RequestMapping(value = "/exportSysEmpBankExcel.do", method = {RequestMethod.POST, RequestMethod.GET})
	public void exportSysEmpBankExcel(HttpServletRequest request, HttpServletResponse response) {
		String rlNm = request.getParameter("rlNm");
		String usrNm = request.getParameter("usrNm");
		String bkCd = request.getParameter("bkCd");
		String rcptUnt = request.getParameter("rcptUnt");
		String accNo = request.getParameter("accNo");
		String certNo = request.getParameter("certNo");

		SysEmpBankAccQueryCondition qc = new SysEmpBankAccQueryCondition();
		if (StringUtils.isNotEmpty(rlNm)) {
			qc.setRlNm(rlNm);
		}
		if (StringUtils.isNotEmpty(usrNm)) {
			qc.setUsrNm(usrNm);
		}
		if (StringUtils.isNotEmpty(bkCd)) {
			qc.setBkCd(bkCd);
		}
		if (StringUtils.isNotEmpty(rcptUnt)) {
			qc.setRcptUnt(rcptUnt);
		}
		if (StringUtils.isNotEmpty(accNo)) {
			qc.setAccNo(accNo);
		}
		if (StringUtils.isNotEmpty(certNo)) {
			qc.setCertNo(certNo);
		}

		List<SysEmpBankAccVO> list = this.sysEmpBankAccService.searchList(qc);
		Map<String,String> certtypmap = this.sysEmpBankAccService.searchGroupToMap(CurrentThreadContext.getFlServiceSysCd(),CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_GRP_CERT_TYP_CD);
		Map<String,String> signPltmap = new HashMap<String,String>();
		signPltmap.put("2","信联");
		for(SysEmpBankAccVO _vo: list){
			if(StringUtils.isNotEmpty(_vo.getCertTypCd())){
				_vo.setCertTypNm(certtypmap.get(_vo.getCertTypCd()));
			}
			if(StringUtils.isNotEmpty(_vo.getSignPlt())){
				_vo.setSignPlt(signPltmap.get(_vo.getSignPlt()));
			}
			if(StringUtils.isNotEmpty(_vo.getIsDel()) && _vo.getIsDel().intValue()==0){
				_vo.setIsDelNm("绑定中");
			}else {
				_vo.setIsDelNm("已解绑");
			}
		}
		ExportParams params = new ExportParams("代扣卡记录", "代扣卡记录", ExcelType.HSSF);
		//HSSF是POI工程对Excel 97(-2007)文件操作的纯Java实现;
		//XSSF是POI工程对Excel 2007 OOXML (.xlsx)文件操作的纯Java实现
		//SXSSF基于XSSF的低内存占用的API
		params.setColor(HSSFColor.BRIGHT_GREEN.index);//表头颜色
		params.setStyle(ExcelExportStylerDefaultImpl.class);//ExcelExportStylerBorderImpl 有边框样式 ExcelExportStylerColorImpl  有边框间隔行样式 ExcelExportStylerDefaultImpl	默认的样式
		Workbook workbook = ExcelExportUtil.exportExcel(params, SysEmpBankAccVO.class, list);
		OutputStream ouputStream = null;
		try {
			String filename="代扣卡记录";
			filename=new String(filename.getBytes("UTF-8"),"ISO8859-1");
			response.reset();
			response.setCharacterEncoding("utf-8");
			response.setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");// 设定输出文件头
			response.setContentType("application/x-msdownload");// 定义输出类型
			ouputStream = response.getOutputStream();
			workbook.write(ouputStream);
			ouputStream.flush();
			ouputStream.close();
		} catch (UnsupportedEncodingException e) {
			BaseLogUtils.error(logger, "-", "异常", e);
		} catch (IOException e) {
			BaseLogUtils.error(logger, "-", "异常", e);
		}finally {
			//关闭流
			if(ouputStream!=null){
				try {
					ouputStream.close();
				} catch (IOException e) {
					BaseLogUtils.error(logger, "-", "异常", e);
				}
			}
		}
	}

	/**
	 *信联银行卡签约绑定
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/signedBank.do")
	@ResponseBody
	public DataResultVO signedBank(HttpServletRequest request, HttpServletResponse response) throws BaseException{
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "绑定成功");
		String cardType = request.getParameter("cardType");//银行卡类型
		String bankName = request.getParameter("bankName");//银行名称
		String certNo = request.getParameter("certNo");//身份证
		String payAcntName = request.getParameter("payAcntName");//账户名称字符串
		String payAcntCode = request.getParameter("payAcntCode");//付款账号字符串
		String cardTel = request.getParameter("cardTel");//银行卡手机号
		String fstOrg = request.getParameter("fstOrg");
		String secOrg = request.getParameter("secOrg");
		String thdOrg = request.getParameter("thdOrg");
		if(StringUtils.isEmpty(cardType) || "1".equals(cardType)){
			logger.info("银行卡类型是信用卡不支持");
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("暂不支持信用卡");
			return result;
		}
		if(StringUtils.isEmpty(payAcntCode)){
			logger.info("信联银行卡签约绑定失败==银行卡号空card_no");
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("银行卡号不能为空");
			return result;
		}
		if(StringUtils.isEmpty(fstOrg)){
			logger.info("信联银行卡签约绑定失败==银行简称空fstOrg");
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("银行简称不能为空");
			return result;
		}
		if(StringUtils.isEmpty(CurrentThreadContext.getCurrentUserId())){
			logger.info("信联银行卡签约绑定失败==用户id为空");
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("系统错误，请重新登录");
			return result;
		}
		try {
			Long cmmcstbankid = this.sysEmpBankAccService.getFun("FN_GEN_SYS_EMP_BANK_ACC_ID");
			//param(PHONE登陆手机号,customer_name客户姓名,cert_no身份证号码,card_no银行卡号,sign_obj_id签约绑定对象,card_type银行卡类型,card_tel手机号);
			CmmRealAuthVO celebrityBkvo = new CmmRealAuthVO();
			celebrityBkvo.setPhone(String.valueOf(CurrentThreadContext.getCurrentUserId()));
			celebrityBkvo.setCustomerName(payAcntName);
			celebrityBkvo.setCertNo(certNo);
			celebrityBkvo.setCardNo(payAcntCode);
			celebrityBkvo.setSignObjId(String.valueOf(cmmcstbankid));
			celebrityBkvo.setCardType(cardType);
			//celebrityBkvo.setCardTel(cardTel);//三要素认证不传手机号
			DataResultDTO celrest = this.celebrityBk(celebrityBkvo);
			if ("0".equals(celrest.getCode())) {
				//实名认证失败
				logger.info("信联银行卡签约绑定失败==实名认证失败" + JSON.toJSONString(celebrityBkvo));
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(celrest.getInfo());
				return result;
			}

			SysEmpBankAccQueryCondition empbankqc = new SysEmpBankAccQueryCondition();
			empbankqc.setUsrId(CurrentThreadContext.getCurrentUserId());
			List<SysEmpBankAccVO> empbankvolist = this.sysEmpBankAccService.searchEmpBankList(empbankqc);
			boolean isbank = true;
			for (SysEmpBankAccVO _vo : empbankvolist) {
				if ("2".equals(_vo.getSignPlt())) {
					if (null != _vo.getIsDel() && _vo.getIsDel().intValue() == 0) {
						isbank = false;
					} else {
						if (fstOrg.equals(_vo.getBkCd()) && payAcntCode.equals(_vo.getAccNo())) {
							SysEmpBankAccVO modiyvo = new SysEmpBankAccVO();
							modiyvo.setId(_vo.getId());
							modiyvo.setIsDel(0);
							boolean modifyrest = this.sysEmpBankAccService.modify(modiyvo);
							if (modifyrest) {
								return result;
							}
						}
					}
				}
			}

			if (isbank) {
				String char_set = "02"; //字符集
				String version_no = "1.0"; //接口版本
				String busi_id = "1001";//业务编码
				String biz_type = "PFDKSignContract";//业务类型
				String partner_id = PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_ID);//合作商户编号
				String sign_obj_id = String.valueOf(cmmcstbankid);//签约序列号
				String cert_type = "01";//证件类型身份证
				String cert_no = DESedeEncrypt.encrypt(certNo);//证件号码 加密后传输，采用 3DES 算法
				String bank_abbr = fstOrg;//银行编码 系统查出
				String pay_acnt_code = DESedeEncrypt.encrypt(payAcntCode);//付款账号
				String pay_acnt_type = cardType;//账号类型
				String pay_acnt_name = DESedeEncrypt.strToHex(payAcntName);//账户名称

				CmmBankNoQC cmmbanknoqc = new CmmBankNoQC();
				cmmbanknoqc.setFstOrg(fstOrg);
				cmmbanknoqc.setSecOrg(secOrg);
				cmmbanknoqc.setThdOrg(thdOrg);
				String open_bank_str = this.sysEmpBankAccService.qcBankNo(cmmbanknoqc);
				String open_bank_code = open_bank_str;//支付行号
				String charge_limit = "100000000";//单笔限额(分)
				String begin_date = DateUtils.getCurrentDateStr("yyyyMMdd"); //协议开始时间
				Calendar calendar = Calendar.getInstance();
				Date date = new Date();
				calendar.setTime(date);
				calendar.add(Calendar.YEAR, 50);//有效期50年
				date = calendar.getTime();
				String end_date = DateUtils.formatDateToString(date, "yyyyMMdd");//协议结束时间
				String linked_addr = "";//联系地址
				String linked_tel = "";//联系电话
				String contract_date = DateUtils.getCurrentDateStr("yyyyMMdd");//签约日期
				String printStr = new StringBuilder().append(char_set).append(version_no).append(busi_id).append(biz_type).append(partner_id).append(sign_obj_id).append(cert_type).append(cert_no).append(bank_abbr).append(pay_acnt_code).append(pay_acnt_type).append(pay_acnt_name).append(open_bank_code).append(charge_limit).append(begin_date).append(end_date).append(linked_addr).append(linked_tel).append(contract_date).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
				String mac = MD5Utils.getInstance().encrypt(printStr, "UTF-8");// 验证签名值

				List<BasicNameValuePair> httpparams = new ArrayList<BasicNameValuePair>();
				httpparams.add(new BasicNameValuePair("char_set", char_set));
				httpparams.add(new BasicNameValuePair("version_no", version_no));
				httpparams.add(new BasicNameValuePair("busi_id", busi_id));
				httpparams.add(new BasicNameValuePair("biz_type", biz_type));
				httpparams.add(new BasicNameValuePair("partner_id", partner_id));
				httpparams.add(new BasicNameValuePair("sign_obj_id", sign_obj_id));
				httpparams.add(new BasicNameValuePair("cert_type", cert_type));
				httpparams.add(new BasicNameValuePair("cert_no", cert_no));
				httpparams.add(new BasicNameValuePair("bank_abbr", bank_abbr));
				httpparams.add(new BasicNameValuePair("pay_acnt_code", pay_acnt_code));
				httpparams.add(new BasicNameValuePair("pay_acnt_type", pay_acnt_type));
				httpparams.add(new BasicNameValuePair("pay_acnt_name", pay_acnt_name));
				httpparams.add(new BasicNameValuePair("open_bank_code", open_bank_code));
				httpparams.add(new BasicNameValuePair("charge_limit", charge_limit));
				httpparams.add(new BasicNameValuePair("begin_date", begin_date));
				httpparams.add(new BasicNameValuePair("end_date", end_date));
				httpparams.add(new BasicNameValuePair("linked_addr", linked_addr));
				httpparams.add(new BasicNameValuePair("linked_tel", linked_tel));
				httpparams.add(new BasicNameValuePair("contract_date", contract_date));
				httpparams.add(new BasicNameValuePair("mac", mac));

				logger.info("信联银行卡签约绑定签名数据==" + printStr);
				logger.info("信联银行卡签约绑定传入数据==" + JSON.toJSONString(httpparams));

				String xinlianresult = "";
				if (StringUtils.isNotEmpty(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE)) && "official".equals(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE))) {
					//生产
					xinlianresult = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams, "UTF-8", "GBK");
				} else {
					//测试
					xinlianresult = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams, "UTF-8", "GBK");
				}
				Map<String, String> remap = UrlUtils.getParamsKey(xinlianresult);
				String re_char_set = remap.get("char_set") != null ? remap.get("char_set") : "";//字符集
				String re_partner_id = remap.get("partner_id") != null ? remap.get("partner_id") : "";//合作商户编号
				String re_busi_id = remap.get("busi_id") != null ? remap.get("busi_id") : "";//业务编码
				String re_sign_obj_id = remap.get("sign_obj_id") != null ? remap.get("sign_obj_id") : "";//签约序列号
				String re_sign_no = remap.get("sign_no") != null ? remap.get("sign_no") : "";//签约号
				String re_sign_time = remap.get("sign_time") != null ? remap.get("sign_time") : "";//签约完成时间
				String re_sign_result = remap.get("sign_result") != null ? remap.get("sign_result") : "";//签约结果
				String re_sign_result_desc = remap.get("sign_result_desc") != null ? remap.get("sign_result_desc") : "";//签约结果描述
				String re_mac = remap.get("mac") != null ? remap.get("mac") : "";//签名数据
				String verifyStr = new StringBuilder().append(re_char_set).append(re_partner_id).append(re_busi_id).append(re_sign_obj_id).append(re_sign_no).append(re_sign_time).append(re_sign_result).append(re_sign_result_desc).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
				String verifymac = MD5Utils.getInstance().encrypt(verifyStr, "GBK");// 验证签名值
				logger.info("信联银行卡签约绑定返回数据==" + xinlianresult);
				logger.info("信联银行卡签约绑定返回签名数据==" + verifyStr + "####返回签名值==" + verifymac);
				if (verifymac.equals(re_mac)) {
					if ("0000".equals(re_sign_result)) {
						//返回成功
						SysEmpBankAccVO addempbankvo = new SysEmpBankAccVO();
						addempbankvo.setId(cmmcstbankid);
						addempbankvo.setUsrId(CurrentThreadContext.getCurrentUserId());
						addempbankvo.setRcptUnt(payAcntName);
						addempbankvo.setAccNo(payAcntCode);
						addempbankvo.setBkNm(bankName);
						addempbankvo.setBkNo(open_bank_str);
						addempbankvo.setCertTypCd("0");
						addempbankvo.setCertNo(certNo);
						addempbankvo.setResMp(cardTel);
						addempbankvo.setSignPlt("2");
						addempbankvo.setSignNo(re_sign_no);
						addempbankvo.setIsDeduct(1);
						addempbankvo.setSysCd(CurrentThreadContext.getFlServiceSysCd());
						addempbankvo.setBkCd(fstOrg);
						addempbankvo.setCardType(Long.valueOf(cardType));
						this.sysEmpBankAccService.add(addempbankvo);
					} else {
						result.setSuccess(BaseConstant.IS_YESNO_NO);
						result.setInfo(re_sign_result_desc);
					}

					CmmSignedBankVO signedbankmap = new CmmSignedBankVO();
					signedbankmap.setSignObjId(sign_obj_id);
					signedbankmap.setCertType(cert_type);
					signedbankmap.setCertNo(certNo);
					signedbankmap.setBankAbbr(bank_abbr);
					signedbankmap.setPayAcntCode(payAcntCode);
					signedbankmap.setPayAcntType(pay_acnt_type);
					signedbankmap.setPayAcntName(payAcntName);
					signedbankmap.setOpenBankCode(open_bank_code);
					signedbankmap.setChargeLimit(charge_limit);
					signedbankmap.setBeginDate(begin_date);
					signedbankmap.setEndDate(end_date);
					signedbankmap.setLinkedAddr(linked_addr);
					signedbankmap.setLinkedTel(linked_tel);
					signedbankmap.setContractDate(contract_date);
					signedbankmap.setSignNo(re_sign_no);
					signedbankmap.setSignTime(re_sign_time);
					signedbankmap.setSignResult(re_sign_result);
					signedbankmap.setSignResultDesc(re_sign_result_desc);
					signedbankmap.setPhone(String.valueOf(CurrentThreadContext.getCurrentUserId()));
					this.sysEmpBankAccService.addCmmSignedBank(signedbankmap);
				}else{
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo(remap.get("message_desc"));
				}
			}else{
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("该卡已经绑定过了！");
			}
		}catch (Exception e){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("绑定银行卡异常");
			logger.info("绑定银行卡异常===="+e);
		}
		return result;
	}
	
	/**
	 * 信联查询银行卡bin
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/queryBankBin.do")
	@ResponseBody
	public DataResultVO queryBankBin(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		String cardNo = request.getParameter("cardNo");//银行卡号
		if(StringUtils.isEmpty(cardNo)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("银行卡号不能为空");
			return result;
		}
		try {
			String char_set = "00"; //字符集
			String version_no = "1.0"; //接口版本
			String biz_type = "CardBinQuery";//业务类型CardBinQueryN
			String partner_id = PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_ID);//合作商户编号
			String card_no = DESedeEncrypt.encrypt(cardNo);//银行卡号 加密后传输，采用 3DES 算法
			String printStr = new StringBuilder().append(char_set).append(version_no).append(biz_type).append(partner_id).append(card_no).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
			String mac = MD5Utils.getInstance().encrypt(printStr, "GBK");//签名值


			List<BasicNameValuePair> httpparams = new ArrayList<BasicNameValuePair>();
			httpparams.add(new BasicNameValuePair("char_set", char_set));
			httpparams.add(new BasicNameValuePair("version_no", version_no));
			httpparams.add(new BasicNameValuePair("biz_type", biz_type));
			httpparams.add(new BasicNameValuePair("partner_id", partner_id));
			httpparams.add(new BasicNameValuePair("card_no", card_no));
			httpparams.add(new BasicNameValuePair("mac", mac));

			logger.info("信联查询银行卡bin签名数据==" + printStr);
			logger.info("信联查询银行卡bin传入数据==" + JSONObject.toJSONString(httpparams));

			String xinlianresult = "";

			if (StringUtils.isNotEmpty(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE)) && "official".equals(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE))) {
				//生产
				xinlianresult = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams, "GBK", "GBK");
			} else {
				//测试
				xinlianresult = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams, "GBK", "GBK");
			}
			logger.info("信联查询银行卡bin返回数据==" + xinlianresult);
			Map<String, String> remap = UrlUtils.getParamsKey(xinlianresult);
			String re_partner_id = remap.get("partner_id") != null ? remap.get("partner_id") : "";//合作商户编号
			String re_card_no = remap.get("card_no") != null ? remap.get("card_no") : "";//银行卡号
			String re_bank_name = remap.get("bank_name") != null ? remap.get("bank_name") : "";//银行名称
			String re_bank_code = remap.get("bank_code") != null ? remap.get("bank_code") : "";//银行编码
			String re_card_type = remap.get("card_type") != null ? remap.get("card_type") : "";//银行卡类型
			String re_corp_org = remap.get("corp_org") != null ? remap.get("corp_org") : "";//银行简称
			String re_message_code = remap.get("message_code") != null ? remap.get("message_code") : "";//返回码
			String re_mac = remap.get("mac") != null ? remap.get("mac") : "";//签名数据
//		String verifyStr = new StringBuilder().append(re_partner_id).append(re_card_no).append(re_bank_name).append(re_bank_code).append(re_card_type).append(re_message_code).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
//		String verifymac = MD5Utils.getInstance().encrypt(verifyStr,"GBK");// 验证签名值
//		logger.info("信联查询银行卡bin返回签名数据==" + verifyStr + "####返回签名值==" + verifymac);
			if ("000000".equals(re_message_code)) {
				JSONObject bankjson = new JSONObject();
				//返回成功
				Map<String, String> banknamemap = this.sysEmpBankAccService.getBankNameMap();
				bankjson.put("bankName", banknamemap.get(re_corp_org));
				bankjson.put("bankCode", re_corp_org);
				bankjson.put("cardType", re_card_type);
				CmmBankNoQC banknoqc = new CmmBankNoQC();
				banknoqc.setFstOrg(re_corp_org);
				List<String> qctwobanklist = this.sysEmpBankAccService.qctwobank(banknoqc);
				if (null == qctwobanklist || qctwobanklist.size() == 0) {
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo("暂不支持该卡");
					return result;
				} else {
					bankjson.put("secOrg", qctwobanklist);
				}
				result.setData(bankjson);
			} else {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("暂不支持该卡");
				return result;
			}
			CmmQcbankDetVO bankdetvo = new CmmQcbankDetVO();
			bankdetvo.setCardNo(cardNo);
			bankdetvo.setBankName(re_bank_name);
			bankdetvo.setBankCode(re_corp_org);
			bankdetvo.setCardType(re_card_type);
			bankdetvo.setPhone(String.valueOf(CurrentThreadContext.getCurrentUserId()));
			bankdetvo.setStatus(re_message_code);
			this.sysEmpBankAccService.addCmmQcbankDet(bankdetvo);
		}catch (Exception e){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("查询卡bin出现异常");
			logger.info("查询卡bin出现异常===="+e);
		}
		return result;
	}

	/**
	 * 信联实名认证
	 * @param param(PHONE登陆手机号,customer_name客户姓名,cert_no身份证号码,card_no银行卡号,sign_obj_id签约绑定对象,card_type银行卡类型,card_tel手机号);
	 * @return
	 * @throws Exception
	 */
	public DataResultDTO celebrityBk(CmmRealAuthVO param) throws BaseException {
		DataResultDTO authresult=new DataResultDTO(String.valueOf(BaseConstant.IS_YESNO_NO),"身份信息或手机号错误");
		String PHONE = param.getPhone() != null ? param.getPhone() : "";
		String customer_name_str = param.getCustomerName() != null ? param.getCustomerName() : "";
		String cert_no_str = param.getCertNo() != null ? param.getCertNo() : "";
		String card_no_str=param.getCardNo() != null ? param.getCardNo() : "";
		String char_set = "02"; //字符集
		String version_no = "1.0"; //接口版本
		String biz_type = "MIXAuthenticate";//业务类型
		String partner_id = PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_ID);//合作商户编号
		String busi_id = "1001";//业务编码
		String sign_obj_id = param.getSignObjId() != null ? param.getSignObjId() : "";//签约绑定对象
		String customer_name = DESedeEncrypt.strToHex(customer_name_str);//客户姓名
		String cert_type = "01";//证件类型
		String cert_no = DESedeEncrypt.encrypt(cert_no_str);//证件号码
		String card_type = param.getCardType() != null ? param.getCardType() : "";//银行卡类型
		String card_no = DESedeEncrypt.encrypt(card_no_str);//银行卡号 加密后传输，采用 3DES 算法
		String card_tel = param.getCardTel() != null ? param.getCardTel() : "";//手机号
		String printStr = new StringBuilder().append(char_set).append(version_no).append(biz_type).append(partner_id).append(busi_id).append(sign_obj_id).append(customer_name).append(cert_type).append(cert_no).append(card_type).append(card_no).append(card_tel).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
		String mac = MD5Utils.getInstance().encrypt(printStr,"UTF-8");//签名值

		List<BasicNameValuePair> httpparams = new ArrayList<BasicNameValuePair>();
		httpparams.add(new BasicNameValuePair("char_set", char_set));
		httpparams.add(new BasicNameValuePair("version_no", version_no));
		httpparams.add(new BasicNameValuePair("biz_type", biz_type));
		httpparams.add(new BasicNameValuePair("partner_id", partner_id));
		httpparams.add(new BasicNameValuePair("busi_id", busi_id));
		httpparams.add(new BasicNameValuePair("sign_obj_id", sign_obj_id));
		httpparams.add(new BasicNameValuePair("customer_name", customer_name));
		httpparams.add(new BasicNameValuePair("cert_type", cert_type));
		httpparams.add(new BasicNameValuePair("cert_no", cert_no));
		httpparams.add(new BasicNameValuePair("card_type", card_type));
		httpparams.add(new BasicNameValuePair("card_no", card_no));
		httpparams.add(new BasicNameValuePair("card_tel", card_tel));
		httpparams.add(new BasicNameValuePair("mac", mac));

		logger.info("信联实名认证签名数据=="+printStr);
		logger.info("信联实名认证传入数据=="+ JSON.toJSONString(httpparams));

		String result = "";
		if(StringUtils.isNotEmpty(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE)) && "official".equals(PropertiesCacheUtils.getProperty(CustPayConstant.ISOFFICIAL_CODE))){
			//生产
			result = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams,"UTF-8","GBK");
		}else {
			//测试
			result = HttpClientUtils.httpsPost(PropertiesCacheUtils.getProperty(CustPayConstant.XIN_LIAN_HOST), httpparams,"UTF-8","GBK");
		}
		Map<String, String> remap = UrlUtils.getParamsKey(result);
		String re_partner_id = remap.get("partner_id") != null ? remap.get("partner_id") : "";//合作商户编号
		String re_busi_id = remap.get("busi_id") != null ? remap.get("busi_id") : "";//业务编码
		String re_sign_obj_id = remap.get("sign_obj_id") != null ? remap.get("sign_obj_id") : "";//签约绑定对象
		String re_sign_no = remap.get("sign_no") != null ? remap.get("sign_no") : "";//签约流水号
		String re_sign_time = remap.get("sign_time") != null ? remap.get("sign_time") : "";//签约完成时间
		String re_sign_result = remap.get("sign_result") != null ? remap.get("sign_result") : "";//签约结果
		String re_sign_result_desc = remap.get("sign_result_desc") != null ? remap.get("sign_result_desc") : "";//签约结果描述
		String re_mac = remap.get("mac") != null ? remap.get("mac") : "";//签名数据
		String verifyStr = new StringBuilder().append(re_partner_id).append(re_busi_id).append(re_sign_obj_id).append(re_sign_no).append(re_sign_time).append(re_sign_result).append(re_sign_result_desc).append(PropertiesCacheUtils.getProperty(CustPayConstant.PARTNER_KEY)).toString();
		String verifymac = MD5Utils.getInstance().encrypt(verifyStr,"GBK");// 验证签名值
		logger.info("信联实名认证返回数据==" + result);
		logger.info("信联实名认证返回签名数据==" + verifyStr + "####返回签名值==" + verifymac);
		if(verifymac.equals(re_mac)){
			if("0000".equals(re_sign_result)){
				authresult.setCode(String.valueOf(BaseConstant.IS_YESNO_YES));
				authresult.setInfo("认证成功");
			}else{
				authresult.setCode(String.valueOf(BaseConstant.IS_YESNO_NO));
				authresult.setInfo(re_sign_result_desc);
			}
			CmmRealAuthVO saveCmmRealAuthmap = new CmmRealAuthVO();
			saveCmmRealAuthmap.setSignObjId(sign_obj_id);
			saveCmmRealAuthmap.setCustomerName(customer_name_str);
			saveCmmRealAuthmap.setCertType(cert_type);
			saveCmmRealAuthmap.setCertNo(cert_no_str);
			saveCmmRealAuthmap.setCardType(card_type);
			saveCmmRealAuthmap.setCardNo(card_no_str);
			saveCmmRealAuthmap.setCardTel(card_tel);
			saveCmmRealAuthmap.setSignNo(re_sign_no);
			saveCmmRealAuthmap.setSignTime(re_sign_time);
			saveCmmRealAuthmap.setSignResult(re_sign_result);
			saveCmmRealAuthmap.setSignResultDesc(re_sign_result_desc);
			saveCmmRealAuthmap.setPhone(PHONE);
			this.sysEmpBankAccService.addCmmRealAuth(saveCmmRealAuthmap);
		}
		return authresult;
	}
	
	/**
	 *信联三级银行地址
	 * @param request
	 * @param response
	 * @return
	 * @throws BaseException
	 */
	@RequestMapping(value = "/queryThdOrg.do")
	@ResponseBody
	public DataResultVO queryThdOrg(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		String fstOrg = request.getParameter("fstOrg");//一级
		String secOrg = request.getParameter("secOrg");//二级
		if(StringUtils.isEmpty(fstOrg) || StringUtils.isEmpty(secOrg)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("地区不能为空");
			return result;
		}
		CmmBankNoQC banknoqc = new CmmBankNoQC();
		banknoqc.setFstOrg(fstOrg);
		banknoqc.setSecOrg(secOrg);
		List<String> banklist = this.sysEmpBankAccService.qcThreebank(banknoqc);
		String otherorg = "";
		for(int i=0;i<banklist.size();i++){
			if(null != banklist.get(i) && "其它".equals(banklist.get(i))){
				otherorg = banklist.get(i);
				banklist.remove(i);
				break;
			}
		}
		if(StringUtils.isNotEmpty(otherorg)){
			banklist.add(otherorg);
		}
		result.setData(banklist);
		return result;
	}
}

